package com.example.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

//员工类
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("emp")
public class Emp {

    //员工ID
    @TableId(type = IdType.AUTO)
    private Integer id;
    //员工姓名
    private String name;
    //员工年龄
    private Integer age;
    //员工性别，1：男，2：女
    private Short gender;
    //员工职位
    private String job;
    //入职日期
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate entrydate;
    //创建时间
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    //最后操作时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
